package com.yuwei.controller;

import com.alibaba.fastjson.JSON;
import com.yuwei.bean.Menus;
import com.yuwei.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {

    @Autowired
    HomeService homeService;

    @GetMapping("/menus")
    String menus()
    {
        Menus menus = homeService.getMenus();
        return JSON.toJSONString(menus);
    }
}
